#include<bits/stdc++.h>
using namespace std;
int main(){
	int n=1;//2*n*n-1
	int num;
	char out;
	cin >> num >> out;
	while(2*n*n-1 <= num){
		n++;
	}
	n--;
	for(int i = n;i >= 1;i--){
		for(int j = 0;j < n-i;j++){
			cout << " ";
		}
		for(int j = 0;j < 2*i-1;j++){
			cout << out;
		}
		cout << "\n";
	}
	for(int i = 2;i <= n;i++){
		for(int j = 0;j < n-i;j++){
			cout << " ";
		}
		for(int j = 0;j < 2*i-1;j++){
			cout << out;
		}
		cout << "\n";
	}
	cout << num-2*n*n+1;
	return 0;
}

